feat(cost): expose priced-hours coverage and estimated queue rates - #129
Open
khluu wants to merge 1 commit into
Open
feat(cost): expose priced-hours coverage and estimated queue rates#129khluu wants to merge 1 commit into
khluu wants to merge 1 commit into
Conversation
The Cost page total only covered ~20% of compute hours (7 of 33 queues priced) while presenting a single Total Cost figure. Add estimated, clearly-sourced rates for the large partner/self-hosted queues (H200 slices, AMD MI250/MI300X/MI355X, H100/B200/L4/A100/GH200 pools), expose pricedHoursShare/estimatedHoursShare from /api/cost, mark estimated rows with an 'est.' suffix in the Cost by Queue table, and make the Unpriced Queues card expandable with the remaining unpriced queue names.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
On
/cost(2026-08-20 → 2026-09-03), Total Cost showed $31,176 "Known queues only" while only ~20% of compute hours were priced —h200_35gb(23.3k h) andamd_mi300_1(20.5k h) had no rate, making the headline total misleading.src/app/api/cost/route.ts): addspricedHoursShare/estimatedHoursShare(priced hours / total hours) to the response, plus anestimatedflag per row inbyQueue.src/lib/queue-costs.ts): adds clearly-labeledestimated: truerates with source comments for the large partner/self-hosted queues —h200_35gb(scaled from the known $0.30/hrh200_18gbslice), fullH200, AMDmi250/mi300/mi355(market rental ~$1.80/$2.50/$3.00 per GPU/hr × queue GPU count),mithril-h100-pool,b200-k8s,l4-k8s,a100_queue,gh200_queue,medium_cpu_queue_premerge(assumed r6in.4xlarge),arm64_cpu_queue_premerge(assumed same as postmerge). Queues with no defensible rate (intel-cpu,amd-cpu,arm-cpu,intel-gpu,intel-hpu,ascend,dgx-spark) stay unpriced.src/app/cost/page.tsx):Covers 21% of compute hours (+75% est.)(StatCard API unchanged).est.suffix on $/hr and Est. Cost (no new colors).<details>) and lists the remaining unpriced queue names.computePricingCoverage()helper inqueue-costs.tswith unit tests (src/lib/queue-costs.test.ts).Coverage on the example range goes from 20.5% priced → 20.5% priced + 75.3% estimated (95.8% covered), 4.2% still unpriced (7 small queues, now listed in the card).
Verification
npm test(tsx --test): 65/65 pass, including newqueue-costs.test.ts(5 tests: estimated rates have sources, coverage split math, empty input, previously-unpriced big queues now priced).npm run lint: clean.tsc --noEmit: clean.computePricingCoverageagainst the live/api/costbyQueuepayload.Daily chart investigation (unverified)
The "Daily cost by queue" chart reportedly rendered empty in two headless captures despite 105
dailyCostByQueuerows withtotal_cost > 0. I could not reproduce in a real browser:npm run devneedsDATABRICKS_*/DATABASE_URLcredentials that I don't have access to, so no confirmed bug fix here. Static review of the chart path found no defect: series keys (cost__<queue>/hours__<queue>) contain only-/_(no Recharts path-separator characters), data flows correctly through the stackinguseMemo, andResponsiveContainerhas an explicit height. Most likely the captures were taken before SWR resolved (the page early-returns "Loading cost data...") or beforeResponsiveContainer/bar animation settled in the headless environment. Worth a follow-up capture with network-idle wait if it still reproduces.